package com.rlyy.rsj.db;

import com.rlyy.aibase.db.Dbink;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.sql.Connection;


public class PostgreExecutor {

    private static final Logger logger = LoggerFactory.getLogger(PostgresqlConn.class);

    public static Object invokeSql(ICall icall) {
        Connection conn = null;
        try {
            conn = PostgresqlConn.getConnection();
            return icall.invoke(conn);
        } finally {
            Dbink.close(conn);
        }
    }

    public interface ICall {
        Object invoke(Connection conn);
    }


}
